<?php
// Tangra framework for PHP

require_once(TANGRA_MAIN_DIR.'core/config_loader_file.class.php');
require_once($PATHS->get_hidden().'inc/modules/user_auth_basic/classes/user_auth_config_loader_file.class.php');
require_once($PATHS->get_hidden().'inc/modules/user_auth_basic/classes/user_dbc.class.php');

$user_auth_config_loader_file = new User_Auth_Config_Loader_File($PATHS->get_hidden().'conf/'.TANGRA_MACHINE_SPECIFIC_CONF_FILENAME);

$ua_config['session_var_name'] = $user_auth_config_loader_file->get_session_var_name();
$ua_config['login_page'] = $user_auth_config_loader_file->get_login_page();
$ua_config['returnto'] = $user_auth_config_loader_file->get_url_capture_returnto();
$ua_config['returntoparams'] = $user_auth_config_loader_file->get_url_capture_returnto_params();
$ua_config['after_login_default_page'] = $user_auth_config_loader_file->get_after_login_default_page();
$ua_config['user_dbc_class'] = $user_auth_config_loader_file->get_user_dbc_class();
$ua_config['user_dbc_class_path'] = $user_auth_config_loader_file->get_user_dbc_class_path();
$ua_config['require_ssl_login'] = $user_auth_config_loader_file->get_require_ssl_login();
$ua_config['remember_me_max_period'] = $user_auth_config_loader_file->get_remember_me_max_period();
$ua_config['after_login_protocol'] = $user_auth_config_loader_file->get_after_login_protocol();
$ua_config['after_login_port'] = $user_auth_config_loader_file->get_after_login_port();


require_once($PATHS->get_hidden().$ua_config['user_dbc_class_path']);


require_once(TANGRA_MAIN_DIR.'modules_manager/tangra_module_info_loader_file.class.php');
$user_auth_module_info_loader = new tangra_module_info_loader_file($PATHS->get_hidden().'conf/modules/user_auth_basic/module.ctrl.xml');


$user_auth_module_info = $user_auth_module_info_loader->get_module_info();
global $_MODULES_REGISTER;
$_MODULES_REGISTER->register_module('my_user_auth', $user_auth_module_info);
$_MODULES_REGISTER->set_module_config('my_user_auth', $ua_config);

